package com.hsc.yalebao.tabChongZhi;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.gson.Gson;
import com.hsc.yalebao.base.ActivityStack;
import com.hsc.yalebao.base.BaseActivity;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.base.MainActivity;
import com.hsc.yalebao.http.AppConstants;
import com.hsc.yalebao.http.RequestNet;
import com.hsc.yalebao.model.PayResultBean;
import com.hsc.yalebao.model.ReChargeBaseData;
import com.hsc.yalebao.model.UserBaseBean;
import com.hsc.yalebao.tabMine.ChargeRecordListActivity;
import com.hsc.yalebao.tools.UiUtil;
import com.hsc.yalebao.weight.LogUtils;
import com.hsc.yalebao.weight.MyDialogCancelAndOk;
import com.zhy.http.okhttp.callback.StringCallback;
import java.io.File;
import java.util.HashMap;
import java.util.Timer;
import java.util.TimerTask;
import okhttp3.Call;

public class WeixinResultActivity extends BaseActivity
{
  private static Context context;
  private static File myCaptureFile;
  private String TAG = "WeixinResultActivity";
  private Button finish_but;
  int fiveSecond = 6;
  private TimerTask fiveSecondTimerTask;
  private String guid = "";
  private Handler handler = new Handler()
  {
    public void handleMessage(Message paramAnonymousMessage)
    {
      switch (paramAnonymousMessage.what)
      {
      default:
      case 0:
      }
      do
      {
        return;
        WeixinResultActivity localWeixinResultActivity = WeixinResultActivity.this;
        localWeixinResultActivity.fiveSecond = (-1 + localWeixinResultActivity.fiveSecond);
        LogUtils.e(WeixinResultActivity.this.TAG, "fiveSecond:" + WeixinResultActivity.this.fiveSecond);
      }
      while (WeixinResultActivity.this.fiveSecond != 0);
      WeixinResultActivity.this.fiveSecond = 0;
      WeixinResultActivity.this.fiveSecondTimerTask.cancel();
      WeixinResultActivity.this.getStatus();
    }
  };
  private ImageView iv_title_right;
  private TextView mMoneyTv;
  private ImageView mOneImageview;
  private View mOneLineView;
  private ReChargeBaseData mRchargeBaseData;
  private ImageView mTwoImageView;
  private View mTwoLineView;
  private int memberid;
  private String money = "";
  private MyDialogCancelAndOk myDialogCancelAndOk;
  View.OnClickListener onClickListener = new View.OnClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      switch (paramAnonymousView.getId())
      {
      case 2131099704:
      default:
        return;
      case 2131099699:
        CustomApplication.app.finishActivity(WeixinResultActivity.this);
        return;
      case 2131100384:
      }
      WeixinResultActivity.this.startActivity(new Intent(WeixinResultActivity.context, ChargeRecordListActivity.class));
      CustomApplication.app.finishActivity(WeixinResultActivity.this);
    }
  };
  private Timer timer = new Timer();

  private void getStatus()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("memberid", this.memberid);
    localHashMap.put("orderid", this.mRchargeBaseData.getResult());
    LogUtils.e(this.TAG, "guid" + this.guid);
    LogUtils.e(this.TAG, "client_Ip" + CustomApplication.app.NetIP);
    RequestNet.get(context, AppConstants.URL_GET_RECHARGE_STATUS, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e("获取失败", "getPay()-result:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        LogUtils.d(WeixinResultActivity.this.TAG, "result:" + paramAnonymousString);
        if (UiUtil.IsValueEmpty(paramAnonymousString))
          LogUtils.d(WeixinResultActivity.this.TAG, "result为空");
        do
        {
          PayResultBean localPayResultBean;
          do
            while (true)
            {
              return;
              Gson localGson = new Gson();
              try
              {
                localPayResultBean = (PayResultBean)localGson.fromJson(paramAnonymousString, PayResultBean.class);
                if (localPayResultBean == null)
                {
                  LogUtils.e(WeixinResultActivity.this.TAG, "获取失败");
                  return;
                }
              }
              catch (Exception localException)
              {
                while (true)
                {
                  localException.printStackTrace();
                  localPayResultBean = null;
                }
                if (localPayResultBean.getFlag() == -4)
                {
                  WeixinResultActivity.activityStack.backToMain(MainActivity.class, WeixinResultActivity.context);
                  return;
                }
                if (localPayResultBean.getFlag() == 0)
                {
                  WeixinResultActivity.this.fiveSecond = 6;
                  if (WeixinResultActivity.this.timer != null)
                  {
                    WeixinResultActivity.this.fiveSecondTimerTask = new WeixinResultActivity.FiveSecondTimerTask(WeixinResultActivity.this);
                    WeixinResultActivity.this.timer.schedule(WeixinResultActivity.this.fiveSecondTimerTask, 1000L, 1000L);
                  }
                }
                else
                {
                  if (localPayResultBean.getFlag() == -2)
                  {
                    WeixinResultActivity.this.showDownWireDialog();
                    return;
                  }
                  if (localPayResultBean.getFlag() == -3)
                  {
                    WeixinResultActivity.this.ShowFengjinDialog();
                    return;
                  }
                }
              }
            }
          while (localPayResultBean.getFlag() != 1);
          localPayResultBean.getResult();
        }
        while (WeixinResultActivity.this.fiveSecondTimerTask == null);
        WeixinResultActivity.this.fiveSecondTimerTask.cancel();
      }
    });
  }

  private void init()
  {
    this.mMoneyTv = ((TextView)findViewById(2131100314));
    this.mMoneyTv.setText("充值金额" + this.money + "元");
    this.finish_but = ((Button)findViewById(2131100384));
    this.finish_but.setOnClickListener(this.onClickListener);
    this.mOneImageview = ((ImageView)findViewById(2131100288));
    this.mOneLineView = findViewById(2131100386);
    this.mTwoImageView = ((ImageView)findViewById(2131100289));
    this.mTwoLineView = findViewById(2131100389);
  }

  @TargetApi(19)
  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903233);
    context = this;
    Bundle localBundle = getIntent().getExtras();
    if (localBundle != null)
      this.money = localBundle.getString("money");
    if (CustomApplication.app.userBaseBean != null)
    {
      this.memberid = CustomApplication.app.userBaseBean.getMemberid();
      this.guid = CustomApplication.app.userBaseBean.getGuid();
    }
    setTitle(8, 0, 2130837809, "充值成功", 0, 8, 8, 0, true);
    init();
  }

  protected void onDestroy()
  {
    super.onDestroy();
    if (this.timer != null)
    {
      this.timer.cancel();
      this.timer = null;
    }
    if (this.fiveSecondTimerTask != null)
    {
      this.fiveSecondTimerTask.cancel();
      this.fiveSecondTimerTask = null;
    }
  }

  protected void onPause()
  {
    super.onPause();
  }

  protected void onResume()
  {
    super.onResume();
  }

  @SuppressLint({"NewApi"})
  public void setTitle(int paramInt1, int paramInt2, int paramInt3, String paramString, int paramInt4, int paramInt5, int paramInt6, int paramInt7, boolean paramBoolean)
  {
    View localView = findViewById(2131099716);
    if (paramBoolean)
      localView.setVisibility(0);
    while (true)
    {
      ((TextView)localView.findViewById(2131099701)).setText(paramString);
      ((TextView)localView.findViewById(2131099700)).setVisibility(paramInt1);
      ImageView localImageView = (ImageView)localView.findViewById(2131099699);
      localImageView.setVisibility(paramInt2);
      localImageView.setOnClickListener(this.onClickListener);
      localImageView.setImageResource(paramInt3);
      TextView localTextView = (TextView)localView.findViewById(2131099702);
      localTextView.setVisibility(paramInt5);
      localTextView.setOnClickListener(this.onClickListener);
      this.iv_title_right = ((ImageView)localView.findViewById(2131099704));
      this.iv_title_right.setVisibility(paramInt6);
      this.iv_title_right.setOnClickListener(this.onClickListener);
      this.iv_title_right.setImageResource(paramInt7);
      return;
      localView.setVisibility(8);
    }
  }

  class FiveSecondTimerTask extends TimerTask
  {
    FiveSecondTimerTask()
    {
    }

    public void run()
    {
      WeixinResultActivity.this.handler.sendEmptyMessage(0);
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tabChongZhi.WeixinResultActivity
 * JD-Core Version:    0.6.2
 */